
<html lang="es">
<head>
    <meta charset="utf-8">
    <link rel="stylesheet" href="<?php echo base_url()?>plugins/RGraph/demos/demos.css" type="text/css" media="screen" />    
    <script type="text/javascript" src="<?php echo base_url()?>plugins/RGraph/libraries/RGraph.common.core.js" ></script>
    <script type="text/javascript" src="<?php echo base_url()?>plugins/RGraph/libraries/RGraph.bar.js" ></script>
    <script type="text/javascript" src="<?php echo base_url()?>plugins/RGraph/libraries/RGraph.line.js" ></script>    
    <script type="text/javascript" src="<?php echo base_url()?>plugins/RGraph/libraries/RGraph.common.dynamic.js" ></script>
    <script type="text/javascript" src="<?php echo base_url()?>plugins/RGraph/libraries/RGraph.common.key.js" ></script>
    <script type="text/javascript" src="<?php echo base_url()?>plugins/RGraph/libraries/RGraph.drawing.rect.js" ></script>
    
   
    <link href="<?php echo base_url()?>/css/bootstrap.min.css" rel="stylesheet">
        
        
        <!-- PLUGINS CSS -->

         <link href="<?php echo base_url()?>/plugins/datatable/css/bootstrap.datatable.min.css" rel="stylesheet">
         
        <!--  <link href="<?php echo base_url()?>/plugins/formvalidation/formValidation.min.css" rel="stylesheet">-->
        
        
        <!-- MAIN CSS (REQUIRED ALL PAGE)-->
        <link href="<?php echo base_url()?>/plugins/font-awesome/css/font-awesome.min.css" rel="stylesheet">
        <link href="<?php echo base_url()?>/css/style.css" rel="stylesheet">
        <link href="<?php echo base_url()?>/css/style-responsive.css" rel="stylesheet">
 
        
        <!-- MAIN JAVASRCIPT (REQUIRED ALL PAGE)-->
        <script src="<?php echo base_url()?>/js/jquery.min.js"></script>
        <script src="<?php echo base_url()?>/js/bootstrap.min.js"></script>
        
        <script src="<?php echo base_url()?>/plugins/datatable/js/jquery.dataTables.min.js"></script>
        <script src="<?php echo base_url()?>/plugins/datatable/js/bootstrap.datatable.js"></script>
        
    <!--[if lt IE 9]><script src="../excanvas/excanvas.js"></script><![endif]-->
    

    
    <meta name="robots" content="noindex,nofollow" />
    <meta name="description" content="A Bar chart with a 3D effect" />
    

</head>
<body>


 <div class="container">

<?php if ($salida==2) { ?>
  <div class="row">
        <div class="col-md-8">     
            <table align="center" border="0" cellspacing="0" style="width:100%;">
                <tr>
                    <td align="left" id="imagen">
                        <img src="<?php echo base_url(); ?>img/mtps_report2.jpg" width="175" height="106" />
                    </td>
                    <td align="center">
                        <h5>REPORTE DE EVALUACIONES DEL PERSONAL</h5>
                        <h3 id="titulo"><?php echo $titulo; ?></h3>                
                    </td>
                   <td align="right" id="imagen">
                        <img src="<?php echo base_url(); ?>img/escudo.jpg" width="50%"  />
                    </td>
                </tr>
                <tr>
                    <td colspan="3" align="right">
                        <h6>Fecha: <strong><?php echo date('d-m-Y') ?></strong> </h6>
                    </td>
                </tr>
            </table>    
        </div>
    </div>
    <?php 
    # code...
} else {
    echo "<h3>  $titulo; </h3>";
}?>



      <div class="row">
        <div class="col-md-9"> 
                               <table class="table table-th-block table-info" style="width:100%">
                                    <thead>
                                        <tr>
                                            <th rowspan="2">N°</th>
                                            <th rowspan="2">Oficina</th>
                                            <th colspan="2" align="center" >Puntuaciones</th>
                                            <th colspan="2" align="center" >Cantidad de personas</th>
                                        </tr>
                                        <tr>
                                            <th>Femenino</th>
                                            <th>Masculino</th>
                                            <th>Femenino</th>
                                            <th>Masculino</th>
                                        </tr>

                                    </thead>
                                    <tbody>           
                                        <?php   $cont=1; 
                                       // prueba_v($tabla);
                                            foreach ($tabla as $k) { 
                                                $pun=explode(',', $k['valor']);
                                                $lab=explode(',', $k['label2']);
                                                $cant=explode(',', $k['cant']);
                                                ?>
                                            <tr>
                                                <td><?php echo $cont++;?></td>
                                                <td><?php echo $k['label']?></td>
                                            <?php 
                                                    $n=sizeof($pun);

                                                if ($n==2) {
                                                    echo "<td>".$pun[0]."</td>";
                                                    echo "<td>".$pun[1]."</td>";
                                                    echo "<td>".$cant[0]."</td>";
                                                    echo "<td>".$cant[1]."</td>";

                                                }elseif ($n==1 && $lab[0]=="FEMENINO") {
                                                    echo "<td>".$pun[0]."</td>";
                                                    echo "<td> </td>";
                                                    echo "<td>".$cant[0]."</td>";
                                                    echo "<td> </td>";

                                                }elseif ($n==1 && $lab[0]=="MASCULINO") {
                                                    echo "<td> </td>";
                                                    echo "<td>".$pun[0]."</td>";
                                                    echo "<td> </td>";
                                                    echo "<td>".$cant[0]."</td>";

                                                }else{
                                                    echo "<td> </td>";
                                                    echo "<td> </td>";
                                                    echo "<td> </td>";
                                                    echo "<td> </td>";
                                                }
                                            ?>

                                            </tr>
                                            <?php }?>
                                        
                                    </tbody>
                                </table>        
        </div>
      </div>
      <div class="row">
            <div class="col-md-4">
                <br><br>
                <canvas id="cvs" width="700" height="400">[No canvas support]</canvas>
            </div>
      </div>
</div>

</body>
</html>
<script>
        $(document).ready(function ()
        {
            var data = [8,4,6,9,6];

            var bar = new RGraph.Bar({
                id: 'cvs',
                data: [<?php echo $valor;?>],
                options: {
                    key:{
                        self: [<?php echo $self;?>] ,
                        interactive: true
                    },
                    labels: [<?php echo $label;?>],
                    colors: [<?php echo $color;?>],    
                    gutter: {
                        left: 100,
                        top: 10,
                        bottom: 230,
                        right: 5
                    },                    
                    text: {
                        angle: 0
                    },
                }
            }).draw()
        })
        <?php 
                if ($salida==2) {
                    echo "window.print()";
                }
         ?>

    </script>
